public class Test {
    public static StringBuilder fun(String str) {
        StringBuilder string= new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (string.indexOf(ch + "")==-1) {
                string.append(ch);
            }
        }
        return string;
    }

    public static void main(String[] args) {
        String str="qsqdq";
        System.out.println(fun(str).toString());
    }
}